package homework;

import java.util.ArrayList;
import java.util.HashMap;

public class Work5 {
	public static void main(String[] args) {
		HashMap<Integer, Integer> map=new HashMap<>();
		int[] arr1={1,2,3,4};
		int[] arr2={3,4,5,2};
		ArrayList<Integer> arrayList = new ArrayList<Integer>();
		for(int i=0;i<arr1.length;i++){
			if(map.containsKey(arr1[i])){
				map.put(arr1[i], map.get(arr1[i])+1);
			}else{
				map.put(arr1[i], 1);
			}
		}
		for(int i=0;i<arr2.length;i++){
			if(map.containsKey(arr2[i])){
				map.put(arr2[i], map.get(arr2[i])+1);
			}else{
				map.put(arr2[i], 1);
			}
		}
		for(int c:map.keySet()){
			if(map.get(c)==1){
				arrayList.add(c);
			}
		}
		System.out.println(arrayList);

	}
}
